<%--
    Document   : view fragment for listing posts
    Created on : Mar 10, 2014, 10:54:45 PM
    Author     : Anton Strack
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<div>
    <c:if test="${plotResults != null && plotResults.size() > 0}">
        <section>
            <h3>Plots:</h3>
            <c:forEach items="${plotResults}" var="plotResult" >
                <p><a href="${req.contextPath}?action=view&resource=${fn:toLowerCase(plotResult.getDerivedValue('ResourceTypeName'))}&id=${plotResult.id}">${plotResult.name}</a><br />
                    ${plotResult.description}</p>
                </c:forEach>
        </section>
    </c:if>
    <c:if test="${dialogResults != null && dialogResults.size() > 0}">
        <section>
            <h3>Dialogs</h3>
            <c:forEach items="${dialogResults}" var="dialogResult" >
                <p><a href="${req.contextPath}?action=view&resource=${fn:toLowerCase(dialogResult.getDerivedValue('ResourceTypeName'))}&id=${dialogResult.id}">${dialogResult.name}</a><br />
                    ${dialogResult.description}</p>
                </c:forEach>
        </section>
    </c:if>
    <c:if test="${characterResults != null && characterResults.size() > 0}">
        <section>
            <h3>Characters</h3>
            <c:forEach items="${characterResults}" var="characterResult" >
                <p><a href="${req.contextPath}?action=view&resource=${fn:toLowerCase(characterResult.getDerivedValue('ResourceTypeName'))}&id=${characterResult.id}">${characterResult.name}</a><br />
                    ${characterResult.description}</p>
                </c:forEach>
        </section>
    </c:if>
    <c:if test="${locationResults != null && locationResults.size() > 0}">
        <section>
            <h3>Locations</h3>
            <c:forEach items="${locationResults}" var="locationResult" >
                <p><a href="${req.contextPath}?action=view&resource=${fn:toLowerCase(locationResult.getDerivedValue('ResourceTypeName'))}&id=${locationResult.id}">${locationResult.name}</a><br />
                    ${locationResult.description}</p>
                </c:forEach>
        </section>
    </c:if>
</div>

